<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>${user.userName }的主页</title>
<%@include file="common/top_asset.jsp" %>
<%@include file="common/jquery_ui.jsp" %>
<script type="text/javascript" src="/js/util.js"></script>
<script type="text/javascript" src="/js/home.js"></script>
<script type="text/javascript" src="/js/msg_help.js"></script>
</head>
<body>
    <div style="width: 700px;margin: 0 auto;" class="top_bar">
    	<div style="margin-left: 180px;margin-top: 5px;">
    		<ul>
	    		<li><a href="#">我的首页</a></li>
	    		<li><a href="#">个人主页</a></li>
	    	</ul>
    	</div>
    </div>
	<div style="width: 700px;margin: 0 auto;">
		<div style="width: 200px;float: left;">
			<ul class="user_atten">
				<li>
					<a href="#">
						<strong id="follow_count">${user.followCount }</strong>
						<span>关注</span>
					</a>
				</li>
				<li>
					<a href="#">
						<strong id="fans_count">${user.fansCount }</strong>
						<span>粉丝</span>
					</a>
				</li>
				<li>
					<a href="#">
						<strong id="msg_count">${user.msgCount }</strong>
						<span>微博</span>
					</a>
				</li>
			</ul>
		</div>
		<div style="width: 500px;margin: 0 auto;float: left;">
			<textarea style="width: 100%; height: 100px;" id="content"></textarea>
			<div style="text-align: right;">
				<input value="发布" type="button" onclick="publish_msg()"/>
			</div>
			<p style="height: 12px;clear: both;"></p>
			
			<div class="recomment_content">
				<div style="width: 100%;text-align: left;">
					<s:if test="#request.recommendUsers != null">
						<p style="margin-bottom: 10px;">您还没用关注对象，推荐关注用户：</p>
						<s:iterator value="#request.recommendUsers" id="rUser">
							<p id="${rUser.id }_r_user">
								<s:property value="#rUser.userName"/>
								<a style="text-decoration: underline;" href="javascript:follow(${rUser.id })">关注</a>
							</p>
						</s:iterator>
					</s:if>
				</div>
			</div>
			
			<div id="weibo_area" class="weibo_show">
				<s:if test="#request.msgs != null">
					<s:iterator value="#request.msgs" id="msg">
						<dl style="margin-top: 10px;margin-bottom: 15px;" id="${msg.msgId }_line">
							<dd>
								<p class="content_line" data-type="all_content">
									<a data-type="nick" href="#">${msg.nick }：</a>
									<em data-type="content">${msg.content }</em>
								</p>
								<s:if test="#msg.type == @com.raycloud.common.Constants@FORWARD">
									<s:if test="#msg.transferMsg != null">
										<s:set name="finalMsgId" value="#msg.transferMsg.msgId"></s:set>
										<dl class="transfer_msg" id="${msg.msgId }_line">
											<dd class="arrow W_bgcolor_arrow">
												<em class="W_arrline">◆</em>
											</dd>
											<dt data-type="all_content">
												<a href="#">${msg.transferMsg.nick }</a>
												：
												<em>${msg.transferMsg.content }</em>
											</dt>
											<dd>
												<p style="margin-top: 5px;width: 100%;">
													<s:property value="@com.raycloud.util.DateUtil@showOffsetDate(#msg.transferMsg.addTime)" />
													<span style="float: right;">
															<a href="#">转发(${msg.transferMsg.transferCount })</a> |
															<a href="#">评论(${msg.transferMsg.commentCount })</a>
													</span>
												</p>
											</dd>
										</dl>
									</s:if>
									<s:else>
										<s:set name="finalMsgId" value="#msg.msgId"></s:set>
										<dl class="transfer_msg">
											<dd class="arrow W_bgcolor_arrow">
												<em class="W_arrline">◆</em>
											</dd>
											<dt>
												<em>微博已被原作者删除</em>
											</dt>
										</dl>
									</s:else>
								</s:if>
								<s:else>
									<s:set name="finalMsgId" value="#msg.msgId"></s:set>
								</s:else>
								<p style="margin-top: 5px;width: 100%;">
									<s:property value="@com.raycloud.util.DateUtil@showOffsetDate(#msg.addTime)" />
									<span style="float: right;">
											<a href="javascript:void(0)" onclick="show_msg_transfer('${finalMsgId }')">转发(${msg.transferCount })</a> |
											<a href="#">评论(${msg.commentCount })</a>
									</span>
								</p>
							</dd>
						</dl>
					</s:iterator>
				</s:if>
			</div>
		</div>
	</div>
	
	<div id="msg_transfer_dialog" style="display: none;">
		<div class="follow_msg" id="follow_msg">
			
		</div>
		<div>
			<textarea style="width:100%;height: 100%;" id="transfer_content"></textarea>
			<div style="float: right;">
				<input type="button" id="transfer_btn" value="转发"/>
			</div>
		</div>
	</div>
	
	<div id="dialog" style="display: none"></div>
</body>
</html>